# encoding:utf8
import random
import string

def random_string(length:int) -> str:
    """
    length: 指定随机字符串长度
    """
    base_str = string.digits + string.ascii_letters
    random_str = ''.join(random.choices(base_str, k=length))
    return random_str